#ifndef prs_FrmSplitterStyle_H
#define prs_FrmSplitterStyle_H

#include "prs_FrmFunc.h"
#include "prs_FrmRules.h"
#include "prs_FrmStyleState.h"
#include "frm_control_TSplitter.h"

namespace prs {

///////////////////////////////////////////////////////////////////////////////

struct TNodeFrmVSplitterStyle : public TNodeStyleControl
{
  DECLARE_ClientNode()
  TAttrNodeType<nodeType_VSplitter> NodeType;
  TAttrObject<nodeType_Style,frm::control::TSplitterVert::TStyle> Style;
  //TAttrVariant<attrName_Size> Size;
  //
  TNodeFrmVSplitterStyle() : NodeType(this),Style(this) { Style.Value.SetDefault(); }
};

///////////////////////////////////////////////////////////////////////////////

struct TRuleFrmVSplitterStyle : public snt::TRule
{
  TRuleFrmVSplitterStyle(
    snt::text::TContext &Context,
    svl::TVariant &VParentNode,
    TRuleFrmStyleState &RStyleState
  );
  
private:  
  TNodeFrmVSplitterStyle *GetNode() { return dynamic_cast<TNodeFrmVSplitterStyle*>(vParentNode.Pointer());}
  //
  void FNormal(snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Normal );}
  void FDown  (snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Down );}
  //
  bool FSetSize(snt::text::TNumber::TFuncClosureDoEntryParams &Params);
  //
  svl::TVariant &vParentNode;
  snt::TAlter A;
  TRuleFrmStyleState &rStyleState;
};

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

struct TNodeFrmHSplitterStyle : public TNodeStyleControl
{
  DECLARE_ClientNode()
  TAttrNodeType<nodeType_HSplitter> NodeType;
  TAttrObject<nodeType_Style,frm::control::TSplitterHorz::TStyle> Style;
  //TAttrVariant<attrName_Size> Size;
  //
  TNodeFrmHSplitterStyle() : NodeType(this),Style(this) { Style.Value.SetDefault(); }
};

///////////////////////////////////////////////////////////////////////////////

struct TRuleFrmHSplitterStyle : public snt::TRule
{
  TRuleFrmHSplitterStyle(
    snt::text::TContext &Context,
    svl::TVariant &VParentNode,
    TRuleFrmStyleState &RStyleState
  );
  
private:  
  TNodeFrmHSplitterStyle *GetNode() { return dynamic_cast<TNodeFrmHSplitterStyle*>(vParentNode.Pointer());}
  //
  void FNormal(snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Normal );}
  void FDown  (snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Down );}
  //
  bool FSetSize(snt::text::TNumber::TFuncClosureDoEntryParams &Params);
  //
  svl::TVariant &vParentNode;
  snt::TAlter A;
  TRuleFrmStyleState &rStyleState;
};

///////////////////////////////////////////////////////////////////////////////
}

#endif
